#include "myhread.h"

myhread::myhread(QObject *parent) :
    QThread(parent)
{
    mWidget = (Widget *)parent;
    stopped = false;
    pthread_mutex_init(&condMutex,0);
    pthread_cond_init(&mCond,0);
}

void myhread::stop()
{
    stopped = true;
}

void myhread::run()
{
    static qreal i = 0;
    while (!stopped)
    {

        qDebug() << QString("in MyThread: %1").arg(i++);
        mWidget->updateUi(QString("%1").arg(i));


        msleep(300);
    }
    stopped = false;

}
